import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/co_regulatory_chemical_process_entity.dart';

CoRegulatoryChemicalProcessEntity $CoRegulatoryChemicalProcessEntityFromJson(Map<String, dynamic> json) {
  final CoRegulatoryChemicalProcessEntity coRegulatoryChemicalProcessEntity = CoRegulatoryChemicalProcessEntity();
  final String? areaOrProcess = jsonConvert.convert<String>(json['areaOrProcess']);
  if (areaOrProcess != null) {
    coRegulatoryChemicalProcessEntity.areaOrProcess = areaOrProcess;
  }
  final String? autoControlSys = jsonConvert.convert<String>(json['autoControlSys']);
  if (autoControlSys != null) {
    coRegulatoryChemicalProcessEntity.autoControlSys = autoControlSys;
  }
  final String? autoControlSysShow = jsonConvert.convert<String>(json['autoControlSysShow']);
  if (autoControlSysShow != null) {
    coRegulatoryChemicalProcessEntity.autoControlSysShow = autoControlSysShow;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    coRegulatoryChemicalProcessEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    coRegulatoryChemicalProcessEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    coRegulatoryChemicalProcessEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    coRegulatoryChemicalProcessEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    coRegulatoryChemicalProcessEntity.deleted = deleted;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    coRegulatoryChemicalProcessEntity.id = id;
  }
  final int? keyDangerousChemicalsId = jsonConvert.convert<int>(json['keyDangerousChemicalsId']);
  if (keyDangerousChemicalsId != null) {
    coRegulatoryChemicalProcessEntity.keyDangerousChemicalsId = keyDangerousChemicalsId;
  }
  final String? keyDangerousChemicalsName = jsonConvert.convert<String>(json['keyDangerousChemicalsName']);
  if (keyDangerousChemicalsName != null) {
    coRegulatoryChemicalProcessEntity.keyDangerousChemicalsName = keyDangerousChemicalsName;
  }
  final String? principal = jsonConvert.convert<String>(json['principal']);
  if (principal != null) {
    coRegulatoryChemicalProcessEntity.principal = principal;
  }
  final String? principalId = jsonConvert.convert<String>(json['principalId']);
  if (principalId != null) {
    coRegulatoryChemicalProcessEntity.principalId = principalId;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    coRegulatoryChemicalProcessEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    coRegulatoryChemicalProcessEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    coRegulatoryChemicalProcessEntity.updateDate = updateDate;
  }
  return coRegulatoryChemicalProcessEntity;
}

Map<String, dynamic> $CoRegulatoryChemicalProcessEntityToJson(CoRegulatoryChemicalProcessEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['areaOrProcess'] = entity.areaOrProcess;
  data['autoControlSys'] = entity.autoControlSys;
  data['autoControlSysShow'] = entity.autoControlSysShow;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['keyDangerousChemicalsId'] = entity.keyDangerousChemicalsId;
  data['keyDangerousChemicalsName'] = entity.keyDangerousChemicalsName;
  data['principal'] = entity.principal;
  data['principalId'] = entity.principalId;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension CoRegulatoryChemicalProcessEntityExtension on CoRegulatoryChemicalProcessEntity {
  CoRegulatoryChemicalProcessEntity copyWith({
    String? areaOrProcess,
    String? autoControlSys,
    String? autoControlSysShow,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? id,
    int? keyDangerousChemicalsId,
    String? keyDangerousChemicalsName,
    String? principal,
    String? principalId,
    String? updateBy,
    String? updateById,
    String? updateDate,
  }) {
    return CoRegulatoryChemicalProcessEntity()
      ..areaOrProcess = areaOrProcess ?? this.areaOrProcess
      ..autoControlSys = autoControlSys ?? this.autoControlSys
      ..autoControlSysShow = autoControlSysShow ?? this.autoControlSysShow
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..keyDangerousChemicalsId = keyDangerousChemicalsId ?? this.keyDangerousChemicalsId
      ..keyDangerousChemicalsName = keyDangerousChemicalsName ?? this.keyDangerousChemicalsName
      ..principal = principal ?? this.principal
      ..principalId = principalId ?? this.principalId
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate;
  }
}
